// 路由
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

import RouteView from './components/RouteView'

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Index',
      component: require('./views/index'),
    },

    // 用户列表
    {
      path: '/user',
      component: RouteView,
      children: [
        {
          path: 'list',
          name: 'UserList',
          component: require('./views/user/list'),
        },
        {
          path: 'new',
          name: 'UserNew',
          component: require('./views/user/new'),
        },
      ]
    },

    {
      path: '/img/:type',
      name: 'Img',
      component: require('./views/img'),
    },

    {
      path: '/article/:type',
      component: RouteView,
      children: [
        {
          path: 'new/:id?',
          name: 'ArticleNew',
          component: require('./views/article/new'),
        },
        {
          path: 'list',
          name: 'ArticleList',
          component: require('./views/article/list'),
        },
      ]
    },

    // 设置
    {
      path: '/setting/:type',
      name: 'Setting',
      component: require('./views/setting'),
    },

    // 发展历程
    {
      path: '/developHistory',
      name: 'DevelopHistory',
      component: require('./views/developHistory'),
    },

    // 留言列表
    {
      path: '/advices',
      name: 'Advices',
      component: require('./views/advices'),
    },

    // 招聘相关
    {
      path: '/recruit',
      component: RouteView,
      children: [
        {
          path: 'position',
          name: 'RecruitPosition',
          component: require('./views/recruit/position'),
        },
        {
          path: 'list',
          name: 'RecruitList',
          component: require('./views/recruit/list'),
        },
        {
          path: 'apply',
          name: 'RecruitApply',
          component: require('./views/recruit/apply'),
        },
      ]
    },

    {
      path: '/error',
      alias: '*',
      name: 'Error',
      component: require('./views/error'),
    }
  ],
})
